<template>
    <div ref="pages">
      <div class="tabview newsPageDiv">
        <Breadcrumb 
            :breadcrumbName="breadcrumbName"
            :routerLikeTo="routerLikeTo"
          />
        <div>
          <span class="news-text">{{infoData.nameDwzw}}</span>       
          <a-divider style="margin-top:20px;margin-bottom:20px;" />       
        </div>
          <div class="card-container">
            <a-tabs type="card" @change="callback">
              <a-tab-pane key="1" tab="基本信息" >
                <baseinfo :infoData="infoData" />
              </a-tab-pane>
              <a-tab-pane key="2" tab="资质信息">
                <zzxxTable :codeZzjg="infoData.codeZzjg" />
              </a-tab-pane>
              <a-tab-pane key="3" tab="人员信息">
                <!-- <fsfzrTable :codeZzjg="infoData.codeZzjg" />
                <gltdTable :codeZzjg="infoData.codeZzjg" /> -->
                <cyzyryTable :codeZzjg="infoData.codeZzjg" />
                <cyzcryTable :codeZzjg="infoData.codeZzjg" />
              </a-tab-pane>
              <a-tab-pane key="4" tab="工程绩效">
                <gcyjTable :codeZzjg="infoData.codeZzjg" />
              </a-tab-pane>
              <a-tab-pane key="5" tab="信用评价">
                <xypjTable :codeZzjg="infoData.codeZzjg"/>
              </a-tab-pane>
              <a-tab-pane key="6" tab="良好行为记录">
                <dwhjbTable :codeZzjg="infoData.codeZzjg" />
                <grhjbTable :codeZzjg="infoData.codeZzjg" />
                <dwshgxjTable :codeZzjg="infoData.codeZzjg" />
              </a-tab-pane>
              <a-tab-pane key="7" tab="不良行为记录">
                <blxwjlTable :codeZzjg="infoData.codeZzjg" />
              </a-tab-pane>
            </a-tabs>
        </div>
      </div>
      <!-- <footerPage :page="4" ></footerPage> -->
    </div>
</template>

<script>
import emv from "@/views/center/emptyVue.vue";
import Breadcrumb from "@/components/base/tools/Breadcrumb1";
import baseinfo from "@/views/center/workingUnit/components/baseInfo";
import zzxxTable from "@/views/center/workingUnit/components/zzxx";
import fsfzrTable from "@/views/center/workingUnit/components/ryxx/jsfzr";
import gltdTable from "@/views/center/workingUnit/components/ryxx/gltd";
import cyzyryTable from "@/views/center/workingUnit/components/ryxx/cyzyry";
import cyzcryTable from "@/views/center/workingUnit/components/ryxx/cyzcry";
import gcyjTable from "@/views/center/workingUnit/components/gcyj";
import xypjTable from "@/views/center/workingUnit/components/xypj";
import dwhjbTable from "@/views/center/workingUnit/components/lhxwjl/dwhjb";
import grhjbTable from "@/views/center/workingUnit/components/lhxwjl/grhjb";
import dwshgxjTable from "@/views/center/workingUnit/components/lhxwjl/dwshgxj";
import blxwjlTable from "@/views/center/workingUnit/components/blxwjl";
import api from '@/api/index'
  export default {
    name: "unitDetail",
    inject: ["changeTab"],
    components: {
    //  footerPage,
    Breadcrumb,
    baseinfo,
    zzxxTable,
    // fsfzrTable,
    // gltdTable,
    cyzyryTable,
    cyzcryTable,
    gcyjTable,
    xypjTable,
    dwhjbTable,
    grhjbTable,
    dwshgxjTable,
    blxwjlTable
  },
    props: {
      page: {
        type: String,
        default: '1'
      },
    },
     data(){
      return{
        breadList: [],
        breadcrumbName:'',
        routerLikeTo:'/center/workingUnitPage',
        id:'',
        loading: true,
        infoData:{},
      }
      
    },
    created(){
      this.breadcrumbName = this.$route.query.breadcrumbName;
      this.id = this.$route.query.id;
      this.get_unit_data();
      this.changeTab(5, "workingUnitPage", '<span class="tab_name">从业单位</span>');
    },
    methods: {
      get_unit_data(){
         api.get_unit_by_id(this.id).then(res => {
             this.infoData = res;
             this.loading = false;
              let fileData = this.infoData.file;
              if(fileData!=null && fileData!=""){
                this.infoData.fileupload = JSON.parse(this.infoData.file)
              }
          })
          .catch(err => {
            this.loading = false;
          });
      },
      getScreenHeight(){
        // 获取浏览器可视区域高度
        this.screenHeight =    document.body.clientHeight ; //`${document.documentElement.clientHeight}` 
        window.onresize = function temp() {
          this.screenHeight = document.body.clientHeight;
        };
      },
      callback(key) {
        // console.log("key="+key);
        //  this.$nextTick(()=>{ // 页面渲染完成后的回调
        //           this.getScreenHeight();
        //           this.clientHeight = this.$refs.pages.offsetHeight+195;
        //           console.log(this.screenHeight,this.clientHeight);
        //           if(this.screenHeight>this.clientHeight){
        //             emv.$emit("setfootmargintop",this.screenHeight-this.clientHeight);
        //           }else{
        //             emv.$emit("setfootmargintop",10);
        //           }
        //         });       
      },
    }

  };
</script>
<style lang="less">
.breadcrumb{
  margin-top: 20px;
}
.card-container {
  // background: #f5f5f5;
  overflow: hidden;
  padding: 1px;
  
  .ant-tabs-nav {
    background: #F0F1F5;
    width: 100%;
    position: relative;
    display: inline-block;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding-left: 0;
    list-style: none;
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    transition: -webkit-transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), -webkit-transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  }

  
.ant-table-thead > tr > th {
    padding: 25px 16px;
    overflow-wrap: break-word;
}
.ant-table-thead > tr > th {
    color: rgba(0, 0, 0, 0.85);
    height: 60px;
	  font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #333333;
    text-align: left;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    -webkit-transition: background 0.3s ease;
    transition: background 0.3s ease;
}

  .ant-table-tbody > tr > td {
      overflow-wrap: break-word;
      border-bottom: 2px dotted;
      border-color: #F1F1F1;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #333333;
  }
}
.card-container > .ant-tabs-card > .ant-tabs-content {
  height:auto;
  margin-top: -16px;
}

.card-container > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane {
  background: #fff;
  padding: 1px;
  padding-bottom: 24px;
}

.card-container > .ant-tabs-card > .ant-tabs-bar {
  border-color: #fff;
}

.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab {
  border-color: transparent;
  background: transparent;
}

.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
  border-color: #fff;
  background: #fff;
}

.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
    border-color: #fff;
    background: #fff;
    border-top-color: #337BD7;
    border-radius: 0px;
    color: #333333;
    font-size: 16px;
    font-weight: bold;
    font-family: Microsoft YaHei;
}
.card-container > .ant-tabs-card > .ant-tabs-tab {
    border-color: transparent;
    background: transparent;
    color: #666666;
    font-size: 16px;
    font-weight: 400;
    font-family: Microsoft YaHei;
}
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab {
    height: 60px;
    margin: 0;
    margin-right: 2px;
    padding: 0 40px;
    font-size: 16px;
    line-height: 60px;
}
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container {
    height: 60px;
}
.u-base-info .ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-label {
    padding: 24px 20px;
    text-align: center;
    color: #333333;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    width: 150px;
}
.ant-tabs-bar {
    margin: 0 0 20px 0;
    border-bottom: 1px solid #e8e8e8;
    outline: none;
    -webkit-transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.lhxwjl-bt{
  color: #333333;
  font-size: 16px;
  font-weight: 400;
  margin-top: 20px;
  margin-left: 10px;
  
}


</style>